{include file="header.html"} 

<div class="row">
  <div class="span12"> {include file='shop/nav.html'}
    <form method='post' action='{$appadmin}?m=shop&a=save'>
      <input type='hidden' name='shopid' value='{$data.shopid}' >
      <ul class="nav nav-tabs" id="myTab">
        <li class="active"><a href="#p_base" data-toggle="tab">基本信息</a></li>
        <li><a href="#p_yingye" data-toggle="tab">营业信息</a></li>
        <li><a href="#p_latlng"  data-toggle="tab">地理位置</a></li> 
        </li>
      </ul>
      <div class="tab-content">
        <div class="tab-pane active" id="p_base">
          <table class='table table-bordered' width='100%'>
            
             
            <tr>
              <td width="100">商家名字：</td>
              <td ><input type='text' name='shopname' id='shopname' value='{$data.shopname}' ></td>
            </tr>
            
             <tr  >
            	<td width="100">商家分类：</td>
                <td >
                	<select name="catid" class="w150">
    <option value="0">请选择</option>
    {foreach item=c from=$cat_list}
                <option value="{$c.catid}" {if $data.catid eq $c.catid} selected="selected"{/if}>{$c.cname}</option>
                {foreach item=c_2 from=$c.child}
                	<option value="{$c_2.catid}" {if $data.catid eq $c_2.catid} selected="selected"{/if} class="o_c_2">|__{$c_2.cname}</option>
                    {foreach item=c_3 from=$c_2.child}
                    <option value="{$c_3.catid}" {if $data.catid eq $c_3.catid} selected="selected"{/if} class="o_c_3"> |____{$c_3.cname}</option>
                    {/foreach}
                {/foreach}
                {/foreach}
    </select>
                
                </td>
            </tr>
            
             
            
            <tr>
              <td>店铺主页：</td>
              <td><input type='text' name='shopurl' id='shopurl' value='{$data.shopurl}' ></td>
            </tr>
            
            <tr>
              <td>店主：</td>
              <td><input type='text' name='nickname' id='nickname' value='{$data.nickname}' ></td>
            </tr>
            
            <tr>
            	<td>客服QQ：</td>
                <td><input type="text" name="qq" class="w300" id="qq" value="{$data.qq}" />(多个QQ用空格 隔开,如:333223 322233)</td>
            </tr>
            
              <tr>
              <td>联系电话：</td>
              <td><input type='text' name='telephone' id='telephone' value='{$data.telephone}' ></td>
            </tr>
            <tr>
              <td style="width:60px;">所在地区</td>
              <td><div class="input-row">
                 <select name="sc_id">
                    	<option value="0">请选择</option>
                        {get data=tc model=site_city fun=children(0)}
                        {foreach item=c from=$tc}
                        	<option value="{$c.sc_id}" {if $data.sc_id eq $c.sc_id} selected{/if}>{$c.title}</option>
                            {if $c.child}
                            {foreach item=cc from=$c.child}
                        	<option value="{$cc.sc_id}"  {if $data.sc_id eq $cc.sc_id} selected{/if}>|--{$cc.title}</option>
                            {/foreach}
                            {/if}
                        {/foreach}
                    </select>
                </div>
                 </td>
            </tr>
            <tr>
              <td>所在地址：</td>
              <td><input type='text' name='address' id='address' value='{$data.address}' ></td>
            </tr>
            
            <tr>
            	<td>全国配送</td>
                <td>
                	<input type="radio" name="sendall" {if !$data.sendall} checked{/if}  value="0" > 否
                    <input type="radio" name="sendall" {if  $data.sendall eq 1} checked{/if} value="1" > 是
                </td>
            </tr>
            
            <tr>
              <td>商品数量：</td>
              <td><input type='text' name='goods_num' id='goods_num' value='{$data.goods_num}' ></td>
            </tr>
            <tr>
              <td>销售数量：</td>
              <td><input type='text' name='sold_num' id='sold_num' value='{$data.sold_num}' ></td>
            </tr>
            <tr>
              <td>卖家等级：</td>
              <td><input type='text' name='rank' id='rank' value='{$data.rank}' ></td>
            </tr>
            
            {if $data}
            <tr>
              <td>添加时间：</td>
              <td>{$data.dateline|date:Y-m-d H:i:s}</td>
            </tr>
            <tr>
              <td>最近更新时间：</td>
              <td>{$data.last_time|date:Y-m-d H:i:s}</td>
            </tr>
            {/if}
            <tr>
              <td>logo：</td>
              <td> <div id="up1" url="/index.php?m=upload&a=uploadtao&dir=shop&id={$data.shopid}">
    	<div class="btn-upload">
          <input type="file" name="upimg" id="ud"  class="btn-upload-file" onChange="uploadimg('up1')">
         </div>
 
          <input type="hidden" name="logo" class="imgurl" value="{$data.logo}">
          <span class="imgShow">
          {if $data.logo}
          <img src="{$data.logo|images_site}.100x100.jpg">
          {/if}
          </span>
      </div></td>
            </tr>
            
            <tr>
              <td>横幅图片：</td>
              <td> <div id="up2" url="/index.php?m=upload&a=uploadtao&dir=shop&id={$data.shopid}">
    	<div class="btn-upload">
          <input type="file" name="upimg" id="ud2"  class="btn-upload-file" onChange="uploadimg('up2')">
         </div>
 
          <input type="hidden" name="banner" class="imgurl" value="{$data.banner}">
          <span class="imgShow">
          {if $data.banner}
          <img src="{$data.banner|images_site}.100x100.jpg">
          {/if}
          </span>
      </div></td>
            </tr>
            
            <tr>
              <td>审核状态：</td>
              <td>
              		<input type="radio" name="status" value="4" {if $data.status neq 2} checked="checked"{/if} />隐藏
              		<input type="radio" name="status" value="2" {if $data.status eq 2} checked="checked"{/if}/>显示
              </td>
            </tr>
            <tr>
            	<td>主营产品：</td>
                <td><input type="text" name="zhuying"  value="{$data.zhuying}" class="w300"></td>
            </tr>
            
            <tr>
              <td>简介：</td>
              <td><textarea type='text' name='info' id='info'  style="width:600px;" >{$data.info}</textarea></td>
            </tr>
            
            <tr>
            	<td>内容：</td>
                <td><script type="text/plain" id="content" name="content" >{$data.content}</script></td>
            </tr>
            
          </table>
        </div>
        
        <div class="tab-pane" id="p_yingye">
        <table class="table table-bordered">
        
        
            <tr>
              <td width="100">收藏数：</td>
              <td  ><input type='text' name='fav_num' id='fav_num' value='{$data.fav_num}' ></td>
            </tr>
            <tr>
              <td>积分：</td>
              <td><input type='text' name='grade' id='grade' value='{$data.grade}' ></td>
            </tr>
            <tr>
              <td>送货速度：</td>
              <td><input type='text' name='send_time' id='send_time' value='{$data.send_time}' ></td>
            </tr>
            <tr>
              <td>起送价：</td>
              <td><input type='text' name='send_startprice' id='send_startprice' value='{$data.send_startprice}' ></td>
            </tr>
            <tr>
              <td>配送额外说明：</td>
              <td><input type='text' name='send_info' id='send_info' value='{$data.send_info}' ></td>
            </tr>
            <tr><td>营业开始：</td><td><input type='text' name='yystart' id='yystart' value='{if $data.yystart}{$data.yystart}{else}18:00{/if}' onClick="WdatePicker({dateFmt:'HH:mm'})" ></td></tr>
  <tr><td>营业结束：</td><td><input type='text' name='yyend' id='yyend' value='{if $data.yyend}{$data.yyend}{else}23:59{/if}' onClick="WdatePicker({dateFmt:'HH:mm'})"></td></tr>
            <tr>
              <td>标签：</td>
              <td><input type='text' name='tags' id='tags' value='{$data.tags}' ></td>
            </tr>
        </table>
        </div>
        
        <!--地理位置开始-->
         
      <div class="tab-pane active" id="p_latlng"  >
  <table class="table table-bordered">
  	<tr><td width="100">地理位置：</td><td><input type="text" name="latlng" id="latlng" value="" />  (当前：{$data.lat},{$data.lng}) <br />
    地图搜索：<input type="text" name="word" id="word" /> </td></tr>
    <tr><td></td><td>
    <div id="map_canvas" style="width:600px; height:300px;"></div>
    
    </td></tr>
  </table>
  </div>
      <!--end地理位置-->
      </div>
      <div class="form-btns">
        <input type='submit' value='保存' class='btn btn-success'>
      </div>
    </form>
  </div>
</div>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script> 
<script language="javascript" src="/plugin/jquery/ajaxfileupload.js"></script>
<script language="javascript" src="/static/js/upload.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={const.BDMAPKEY}"></script>
    <script language="javascript">
	function NoSubmit(ev)
	{
		if( ev.keyCode == 13 )
		{
			return false;
		}
		return true;
	}
	$(document).ready(function(){
 
		$("#word").bind("keyup",function(){
			localsearch($(this).val());
		});
	});
   var map = new BMap.Map("map_canvas");
   map.enableScrollWheelZoom();
   map.addControl(new BMap.MapTypeControl());  
   var point = new BMap.Point({if $data.lat>0}{$data.lng},{$data.lat}{else}120.331923,27.318531{/if});
   map.centerAndZoom(point, 14);
   var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);              // 将标注添加到地图中
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
   map.addEventListener("click", function(e){
	   $("#latlng").val(e.point.lat+ ", " + e.point.lng );
   });
   
    function localsearch(word){
	   var local = new BMap.LocalSearch(map, {
		  renderOptions:{map: map}
		});
		local.search(word);
   }
    </script>

<script type="text/javascript" src="/plugin/ueditor/ueditor.config.js?v2"></script>
<script type="text/javascript" src="/plugin/ueditor/ueditor_simple.js"></script>
<script language="javascript" src="/plugin/ueditor/ueditor.all.min.js?v2"></script>

<script language="javascript">
 
var editor=UE.getEditor('content',options)
</script>

{include file="footer.html"}